package com.songlanyun.modules.im.controller;

import com.songlanyun.common.utils.R;
import com.songlanyun.modules.im.dto.ImShopOnlineReqDTO;
import com.songlanyun.modules.im.dto.ImUserInfoReqDTO;
import com.songlanyun.modules.im.service.ImService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/im")
public class ImController {

    @Resource
    private ImService imService;

    @PostMapping("/checkUserInfo")
    public R checkUserInfo(@RequestBody ImUserInfoReqDTO reqDTO) {
        return imService.checkUserInfo(reqDTO);
    }

    @PostMapping("/checkOnline")
    public R checkOnline(@RequestBody ImShopOnlineReqDTO reqDTO) {
        return imService.checkOnline(reqDTO);
    }

    @PostMapping("/getKey")
    public R getKey() {
        return imService.getKey();
    }

    @PostMapping("/customerLogin")
    public R customerLogin(@RequestBody ImUserInfoReqDTO reqDTO) {
        return imService.customerLogin(reqDTO);
    }


}
